﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OQualityStrategyDuiCeEdit.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.MacModel.OQualityStrategyDuiCeEdit" %>


<div class="pageContent">
	<form method="post" action="MacModel/OQualityStrategyDuiCeEdit.aspx?ajaxmethod=update&type=<%=QSType %>&QSID=<%=QSID %>" class="pageForm required-validate" onsubmit="return validateCallback(this, navTabAjaxDone);">
		<div class="pageFormContent" layoutH="56">
             <h2 style=" padding:0px 0px 5px 6px; border-bottom:1px solid #B8D0D6;">品质信息</h2>
             <p>
				<label>对策编号：</label>
				<input  type="text" readonly class="required" value="<%=OQualityStrategyObj.DuiCuBianHao %>" />
			</p>
          
            <p>
				<label>问题点单号：</label>
				<input  type="text" readonly  value="<%=OQualityStrategyObj.RelevantEntryNum %>" />
			</p>
            <div class="divider"></div>
            <p>
				<label>零件号：</label>
				<input  type="text" readonly  value="<%=OQualityStrategyObj.ItemCode %>" />
			</p>
            <p>
				<label>零件名：</label>

				<input type="text" readonly  value="<%=OQualityStrategyObj.ItemName %>" />
			</p>
            <div class="divider"></div>
            <dl style="width:100%; height:60px;">
				<dt>故障描述：</dt>
				<dd>
					<textarea  readonly cols="80" rows="4" ><%=OQualityStrategyObj.FaultDescription %></textarea>
				</dd>
			</dl>
             <h2 style=" padding:0px 0px 5px 6px; border-bottom:1px solid #B8D0D6;">对策信息</h2>
             <p>
				<label>需处理零/部件编号：</label>
				<input name="<%=QSTag %>HandleItemCode" type="text"  class="required" value="<%=GetClassPropertyValue("HandleItemCode") %>" />
			</p>
            <p>
				<label>需处理零/部件名称：</label>
				<input name="<%=QSTag %>HandleItemName" type="text"  class="required" value="<%=GetClassPropertyValue("HandleItemName") %>" />
			</p>
            <div class="divider"></div>
            <dl style="width:100%; height:60px;">
				<dt>对策方案：</dt>
				<dd>
					<textarea name="<%=QSTag %>Scheme" cols="80" rows="4"><%=GetClassPropertyValue("Scheme") %></textarea>
				</dd>
			</dl>

            <dl style="width:100%; height:150px;">
				<dt>&nbsp;</dt>
				<dd>
                    对策方案说明附件
                    <table border="0" cellpadding="2" style="border-spacing:5px!important;width:400px;">       
                        <asp:repeater id="rpSchemeAtt" runat="server">
                            <ItemTemplate>
                                <tr>
                                    <td><%# Container.ItemIndex + 1%>：</td>
                                    <td> 
                                        <input name="ID" type="hidden" value="<%# Eval("ID") %>" />
                                        <input name="AttType" type="hidden" value="<%# Eval("AttType") %>" />
                                        <input  id="<%=QSTag %>schemeHiddenId<%# Container.ItemIndex + 1%>" name="AttPath" type="hidden" value="<%# Eval("AttPath") %>" />
				                        <input type='file' name='filedata' id='<%=QSTag %>schemeUploadId<%# Container.ItemIndex + 1%>' upload='upload' clientId='<%=QSTag %>schemeHiddenId<%# Container.ItemIndex + 1%>,<%=QSTag %>schemeRemarkId<%# Container.ItemIndex + 1%>' dirtype='20' onUploadSuccess='onOQualityStrategyDuiCeEditUploadSuccess' fileTypeDesc='只能上传图片' fileTypeExts='*.jpg;*.gif;*.jpeg;*.png;*.bmp;*.pdf' fileSizeLimit='10MB'/>
                                    </td>
                                    <td><input name="Remark" id="<%=QSTag %>schemeRemarkId<%# Container.ItemIndex + 1%>" type="text"   value="<%# Eval("Remark") %>" /></td>      
                                    <td width="100px">
                                        <a target="_blank" class="downloadhref" href="<%# Eval("AttPath") %>">下载</a>
                                    </td>                      
                                </tr>
                            </ItemTemplate>
                        </asp:repeater>       
                        
                        <%--<tr>
                            <td>1：</td>
                            <td> 
                                <input name="AttType" type="hidden" value="ldc_scheme" />
                                <input  id="ldc_schemeHiddenId1" name="AttPath" type="hidden" value="" />
				                <input type='file' name='filedata' id='ldc_schemeUploadId1' upload='upload' clientId='ldc_schemeUploadId1,ldc_schemeRemarkId1' dirtype='20' onUploadSuccess='onOQualityStrategyAddUploadSuccess' fileTypeDesc='只能上传图片' fileTypeExts='*.jpg;*.gif;*.jpeg;*.png;*.bmp;*.pdf' fileSizeLimit='10MB'/>
                            </td>
                            <td><input name="Remark" id="ldc_schemeRemarkId1" type="text"   value="" /></td>                            
                        </tr>

                       <tr>
                            <td>2：</td>
                            <td> 
                                <input name="AttType" type="hidden" value="ldc_scheme" />
                                <input  id="ldc_schemeHiddenId2" name="AttPath" type="hidden" value="" />
				                <input type='file' name='filedata' id='ldc_schemeUploadId2' upload='upload' clientId='ldc_schemeUploadId2,ldc_schemeRemarkId2' dirtype='20' onUploadSuccess='onOQualityStrategyAddUploadSuccess' fileTypeDesc='只能上传图片' fileTypeExts='*.jpg;*.gif;*.jpeg;*.png;*.bmp;*.pdf' fileSizeLimit='10MB'/>
                            </td>
                            <td><input name="Remark" id="ldc_schemeRemarkId2" type="text"   value="" /></td>                            
                        </tr>
                        <tr>
                            <td>3：</td>
                            <td> 
                                <input name="AttType" type="hidden" value="ldc_scheme" />
                                <input  id="ldc_schemeHiddenId3" name="AttPath" type="hidden" value="" />
				                <input type='file' name='filedata' id='ldc_schemeUploadId3' upload='upload' clientId='ldc_schemeUploadId3,ldc_schemeRemarkId3' dirtype='20' onUploadSuccess='onOQualityStrategyAddUploadSuccess' fileTypeDesc='只能上传图片' fileTypeExts='*.jpg;*.gif;*.jpeg;*.png;*.bmp;*.pdf' fileSizeLimit='10MB'/>
                            </td>
                            <td><input name="Remark" type="text" id="ldc_schemeRemarkId3"   value="" /></td>                            
                        </tr>--%>
                    </table>                    
                   
				</dd>
			</dl>

             <div class="divider"></div>
            <p>
				<label>是否导入：</label>
                 <select name="<%=QSTag %>IsExport" class="required" >
                     <option value="是" <%=GetClassPropertyValue("IsExport")=="是"?"selected":"" %>>是</option>
                     <option value="否" <%=GetClassPropertyValue("IsExport")=="否"?"selected":"" %>>否</option>
                 </select>
			</p>
            <p>
				<label>管制日期：</label>
                <input name="<%=QSTag %>ControlDate" type="text"  class="" value="<%=GetClassPropertyValue("ControlDate")%>" />
			</p>
             <p>
				<label>管制钢号：</label>
                <input name="<%=QSTag %>ControlSteel" type="text"  class="" value="<%=GetClassPropertyValue("ControlSteel")%>" />
			</p>
             <p>
				<label>管制其他：</label>
                <input name="<%=QSTag %>ControlOther" type="text"  class="" value="<%=GetClassPropertyValue("ControlOther")%>" />
			</p>
             <div class="divider"></div>
             <p>
				<label>是否要发服务通报：</label>
                 <select name="<%=QSTag %>SendSvrBulletin" id="OQualityStrategyDuiCeEdit_LDC_SendSvrBulletin" class="required">
                     <option value="是" <%=GetClassPropertyValue("SendSvrBulletin")=="是"?"selected":"" %>>是</option>
                     <option value="否" <%=GetClassPropertyValue("SendSvrBulletin")=="否"?"selected":"" %>>否</option>
                 </select>
			</p>
             <dl id="OQualityStrategyDuiCeEdit_LDC_SendSvrBulletinUpload" style="width:100%; height:60px;">
				<dt>&nbsp;</dt>
				<dd>
                    服务通报附件
					<table border="0" cellpadding="2" style="border-spacing:2px!important; width:400px;">      
                        <asp:repeater id="rpSendsvrBulletin" runat="server">
                            <ItemTemplate>          
                                <tr>                            
                                    <td> 
                                        <input name="ID" type="hidden" value="<%# Eval("ID") %>" />
                                        <input name="AttType" type="hidden" value="<%=QSTag.ToLower() %>sendsvrbulletin" />
                                        <input  id="<%=QSTag.ToLower() %>sendsvrbulletinHiddenId" name="AttPath" type="hidden" value="<%# Eval("AttPath") %>" />
				                        <input type='file' name='filedata' id='<%=QSTag.ToLower() %>sendsvrbulletinUploadId' upload='upload' clientId='<%=QSTag.ToLower() %>sendsvrbulletinHiddenId,<%=QSTag.ToLower() %>sendsvrbulletinRemarkId' dirtype='20' onUploadSuccess='onOQualityStrategyDuiCeEditUploadSuccess' fileTypeDesc='只能上传图片' fileTypeExts='*.jpg;*.gif;*.jpeg;*.png;*.bmp;*.pdf' fileSizeLimit='10MB'/>
                                    </td>
                                    <td><input name="Remark" id='<%=QSTag.ToLower() %>sendsvrbulletinRemarkId' type="text"   value="<%# Eval("Remark") %>" /></td>  
                                    <td width="100px">
                                        <a target="_blank" class="downloadhref" href="<%# Eval("AttPath") %>">下载</a>
                                    </td>                           
                                </tr>                           
                         </ItemTemplate>
                        </asp:repeater>  
                    </table>
				</dd>
			</dl>

            <div class="divider"></div>
            <h2 style=" padding:0px 0px 5px 6px; border-bottom:1px solid #B8D0D6; width:100%; display:block; line-height:25px;">
                零部件处理管制表
                <a href="#" onclick="onOQualityStrategyDuiCeEdit_addPartDetail()" style="float:right; display:block; color:red; padding-right:20px; line-height:25px;">新增零部件管制信息</a>
            </h2>

            <table id="onOQualityStrategyDuiCeEdit_PartList" class="list" style="width:100%">
                <thead>
                    <tr>
                        <th>零/部件钢号</th>
                        <th>相关联零件部件1钢号</th>
                        <th>相关联零件部件2钢号</th>
                        <th>相关联零件部件3钢号</th>
                        <th>零/部件存储位置</th>
                        <th>处理进度</th>
                        <th>处理时间</th>
                        <th>备注</th>
                        <th width="80px"></th>
                    </tr>
                </thead>
                <tbody>
                     <asp:repeater id="rpPartList" runat="server">
                           <ItemTemplate>  
                                 <tr>
                                    <td>
                                        <input type="hidden" name="QSType" value="<%=QSType %>" />
                                        <input type="hidden" name="QSClass" value="p" />
                                        <input type="text" name="PartSerNum" value="<%# Eval("PartSerNum") %>"  class="inputGetFormLimtt"/> 
                                    </td>
                                    <td><input type="text" name="RelevantSteel1" value="<%# Eval("RelevantSteel1") %>" class="inputGetFormLimtt"/> </td>
                                    <td><input type="text" name="RelevantSteel2" value="<%# Eval("RelevantSteel2") %>"  class="inputGetFormLimtt"/> </td>
                                    <td><input type="text" name="RelevantSteel3" value="<%# Eval("RelevantSteel3") %>" class="inputGetFormLimtt" /> </td>
                                    <td>
                                        <select name="StorageLocation" selectvalue="<%# Eval("StorageLocation") %>">
                                            <option value="供应商" >供应商</option>
                                            <option value="厂内原料仓库">厂内原料仓库</option>
                                            <option value="厂内配件仓库">厂内配件仓库</option>
                                            <option value="其他位置">其他位置</option>
                                        </select>

                                    </td>
                                    <td> 
                                         <select name="IsProgress" selectvalue="<%# Eval("IsProgress") %>">
                                            <option value="完成">完成</option>
                                            <option value="未完成">未完成</option>
                                        </select>
                                    </td>
                                    <td><input type="text" name="ProgressDate" class="date" value="<%# Eval("ProgressDate") %>"  class="inputGetFormLimtt"/> </td>
                                    <td><input type="text" name="detailRemark" value="<%# Eval("Remark") %>"  class="inputGetFormLimtt"/> </td>
                                    <td><a href="#" onclick="$(this).closest('tr').remove()">删除</a></td>
                                </tr>
                           </ItemTemplate>
                    </asp:repeater>
                    <%--<tr>
                        <td><input type="text" name="PartSerNum" value="" /> </td>
                        <td><input type="text" name="RelevantSteel1" value="" /> </td>
                        <td><input type="text" name="RelevantSteel2" value="" /> </td>
                        <td><input type="text" name="RelevantSteel3" value="" /> </td>
                        <td>
                            <select name="StorageLocation">
                                <option value="供应商">供应商</option>
                                <option value="厂内原料仓库">厂内原料仓库</option>
                                <option value="厂内配件仓库">厂内配件仓库</option>
                                <option value="其他位置">其他位置</option>
                            </select>

                        </td>
                        <td> 
                             <select name="IsProgress">
                                <option value="完成">完成</option>
                                <option value="未完成">未完成</option>
                            </select>
                        </td>
                        <td><input type="text" name="ProgressDate" class="date" value="" /> </td>
                        <td><input type="text" name="detailRemark" value="" /> </td>
                        <td><a href="#">删除</a></td>
                    </tr>--%>
                </tbody>
                <tfoot>
                   
            </table>

            <div class="divider"></div>

            <h2 style=" padding:0px 0px 5px 6px; border-bottom:1px solid #B8D0D6; width:100%; display:block; line-height:25px;">
                机器处理管制表
                <a href="#" onclick="onOQualityStrategyDuiCeEdit_addSerDetail()" style="float:right; display:block; color:red; padding-right:20px; line-height:25px;">新增机器管制信息</a>
            </h2>
            <table id="onOQualityStrategyDuiCeEdit_SerList" class="list" style="width:100%">
                <thead>
                    <tr>
                        <th>机号</th>
                        <th>相关联零件部件1钢号</th>
                        <th>相关联零件部件2钢号</th>
                        <th>相关联零件部件3钢号</th>
                        <th>机器位置</th>
                        <th>处理进度</th>
                        <th>处理时间</th>
                        <th>备注</th>
                        <th width="80px"></th>
                    </tr>
                </thead>
                <tbody>
                    <asp:repeater id="rpSerList" runat="server">
                           <ItemTemplate>  
                                 <tr>
                                    <td>
                                        <input type="hidden" name="QSType" value="<%=QSType %>" />
                                        <input type="hidden" name="QSClass" value="m" />
                                        <input type="text" name="PartSerNum" value="<%# Eval("PartSerNum") %>"  class="inputGetFormLimtt"/> 
                                    </td>
                                    <td><input type="text" name="RelevantSteel1" value="<%# Eval("RelevantSteel1") %>"  class="inputGetFormLimtt"/> </td>
                                    <td><input type="text" name="RelevantSteel2" value="<%# Eval("RelevantSteel2") %>"  class="inputGetFormLimtt"/> </td>
                                    <td><input type="text" name="RelevantSteel3" value="<%# Eval("RelevantSteel3") %>"  class="inputGetFormLimtt"/> </td>
                                    <td>
                                        <select name="StorageLocation" selectvalue="<%# Eval("StorageLocation") %>">
                                            <option value="厂内下线机器">厂内下线机器</option>
                                             <option value="厂内库存机器">厂内库存机器</option>
                                              <option value="在途机器">在途机器</option>
                                               <option value="经销商库存机">经销商库存机</option>
                                                <option value="用户机器">用户机器</option>
                                        </select>
                                    </td>
                                    <td> 
                                         <select name="IsProgress" selectvalue="<%# Eval("IsProgress") %>">
                                            <option value="完成">完成</option>
                                            <option value="未完成">未完成</option>
                                        </select>
                                    </td>
                                    <td><input type="text" name="ProgressDate" class="date" value="<%# Eval("ProgressDate") %>"  class="inputGetFormLimtt" /> </td>
                                    <td><input type="text" name="detailRemark" value="<%# Eval("Remark") %>"  class="inputGetFormLimtt"/> </td>
                                    <td><a href="#" onclick="$(this).closest('tr').remove()">删除</a></td>
                                </tr>
                           </ItemTemplate>
                    </asp:repeater>
                    <%--<tr>
                        <td><input type="text" name="PartSerNum" value="" /> </td>
                        <td><input type="text" name="RelevantSteel1" value="" /> </td>
                        <td><input type="text" name="RelevantSteel2" value="" /> </td>
                        <td><input type="text" name="RelevantSteel3" value="" /> </td>
                        <td>
                            <select name="StorageLocation">
                                <option value="供应商">供应商</option>
                                <option value="厂内原料仓库">厂内原料仓库</option>
                                <option value="厂内配件仓库">厂内配件仓库</option>
                                <option value="其他位置">其他位置</option>
                            </select>

                        </td>
                        <td> 
                             <select name="IsProgress">
                                <option value="完成">完成</option>
                                <option value="未完成">未完成</option>
                            </select>
                        </td>
                        <td><input type="text" name="ProgressDate" class="date" value="" /> </td>
                        <td><input type="text" name="Remark" value="" /> </td>
                        <td><a href="#">删除</a></td>
                    </tr>--%>
                </tbody>
                <tfoot>
                   
            </table>
             <div class="divider"></div>
        </div>
		<div class="formBar">
			<ul>
				
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
				<li>
					<div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div>
				</li>
			</ul>
		</div>
	</form>
</div>
<script type="text/javascript" >
    function onOQualityStrategyDuiCeEdit_addPartDetail()
    {
        $trTemp = " <tr>" +
                        "<td>" +
                         "<input type=\"hidden\" name=\"QSType\" value=\"<%=QSType %>\" />" +
                        "<input type=\"hidden\" name=\"QSClass\" value=\"p\" />" +
                        "<input type=\"text\" name=\"PartSerNum\" class=\"inputGetFormLimtt\" value=\"\" /> </td>" +
                        "<td><input type=\"text\" name=\"RelevantSteel1\" class=\"inputGetFormLimtt\" value=\"\" /> </td>" +
                        "<td><input type=\"text\" name=\"RelevantSteel2\" class=\"inputGetFormLimtt\" value=\"\" /> </td>" +
                        "<td><input type=\"text\" name=\"RelevantSteel3\" class=\"inputGetFormLimtt\" value=\"\" /> </td>" +
                        "<td>" +
                        "    <select name=\"StorageLocation\">" +
                         "       <option value=\"供应商\">供应商</option>" +
                          "      <option value=\"厂内原料仓库\">厂内原料仓库</option>" +
                           "     <option value=\"厂内配件仓库\">厂内配件仓库</option>" +
                            "    <option value=\"其他位置\">其他位置</option>" +
                          "  </select>" +
                        "</td>" +
                        "<td> " +
                       "      <select name=\"IsProgress\">" +
                       "         <option value=\"完成\">完成</option>" +
                       "         <option value=\"未完成\" selected>未完成</option>" +
                       "     </select>" +
                       " </td>" +
                       " <td><input type=\"text\" name=\"ProgressDate\" class=\"date\" class=\"inputGetFormLimtt\" value=\"\" /> </td>" +
                       " <td><input type=\"text\" name=\"detailRemark\" class=\"inputGetFormLimtt\" value=\"\" /> </td>" +
                       " <td><a href=\"#\" onclick=\"$(this).closest('tr').remove()\">删除</a></td>" +
                    "</tr>";
        $("#onOQualityStrategyDuiCeEdit_PartList").find("tbody").append($trTemp).initUI();
    }
    function onOQualityStrategyDuiCeEdit_addSerDetail() {
        $trTemp = " <tr>" +
                        "<td>"+
                        "<input type=\"hidden\" name=\"QSType\" value=\"<%=QSType %>\" />"+
                        "<input type=\"hidden\" name=\"QSClass\" value=\"m\" />"+
                        "<input type=\"text\" name=\"PartSerNum\" class=\"inputGetFormLimtt\" value=\"\" /> </td>" +
                        "<td><input type=\"text\" name=\"RelevantSteel1\" class=\"inputGetFormLimtt\" value=\"\" /> </td>" +
                        "<td><input type=\"text\" name=\"RelevantSteel2\" class=\"inputGetFormLimtt\" value=\"\" /> </td>" +
                        "<td><input type=\"text\" name=\"RelevantSteel3\" class=\"inputGetFormLimtt\" value=\"\" /> </td>" +
                        "<td>" +
                        "    <select name=\"StorageLocation\">" +
                         "       <option value=\"厂内下线机器\">厂内下线机器</option>" +
                          "      <option value=\"厂内库存机器\">厂内库存机器</option>" +
                           "     <option value=\"在途机器\">在途机器</option>" +
                            "    <option value=\"经销商库存机\">经销商库存机</option>" +
                             "    <option value=\"用户机器\">用户机器</option>" +
                          "  </select>" +
                        "</td>" +
                        "<td> " +
                       "      <select name=\"IsProgress\">" +
                       "         <option value=\"完成\">完成</option>" +
                       "         <option value=\"未完成\" selected>未完成</option>" +
                       "     </select>" +
                       " </td>" +
                       " <td><input type=\"text\" name=\"ProgressDate\" class=\"inputGetFormLimtt\" class=\"date\" value=\"\" /> </td>" +
                       " <td><input type=\"text\" name=\"detailRemark\" class=\"inputGetFormLimtt\" value=\"\" /> </td>" +
                       " <td><a href=\"#\" onclick=\"$(this).closest('tr').remove()\">删除</a></td>" +
                    "</tr>";
        $("#onOQualityStrategyDuiCeEdit_SerList").find("tbody").append($trTemp).initUI();
    }
    function onOQualityStrategyDuiCeEditUploadSuccess(file, data, response) {
        if (!response)
            return false;
        data = eval("(" + data + ")");
        if (!data.uploadResult) {
            alert(data.errMsg);
            return;
        }
        var $imgUploadPath = data.filePath;
        var $trageIds = data.customerInfo.split(",");
        $("#" + $trageIds[0]).val($imgUploadPath);
        $("#" + $trageIds[1]).val(data.soureFileName);//soureFileName
    }
    $(document).ready(function () {
        $(":file[upload]").each(function () {
            uploadifyFun($(this));
        });

        $("#OQualityStrategyDuiCeEdit_LDC_SendSvrBulletin").change(function () {
            ///alert($(this).val());
            if ($(this).val() == "是") {
                $("#OQualityStrategyDuiCeEdit_LDC_SendSvrBulletinUpload").show();
            } else {
                $("#OQualityStrategyDuiCeEdit_LDC_SendSvrBulletinUpload").hide();
            }
        });

        $("select[selectvalue]").each(function () {
            var $selectvalue = $(this).attr("selectvalue");
            $(this).find("option[value='" + $selectvalue + "']").attr("selected", true);
        });
        $("a.downloadhref").each(function () {
            var $href = $(this).attr("href");
           
            if ($href == "")
                $(this).hide();
        })
    })
</script>